package cn.fanqinghong.ymcc.feignClient;

import cn.fanqinghong.ymcc.domain.MessageEmail;
import cn.fanqinghong.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * FAN
 * 2022/7/25  19:58
 */
@Component
public class MessageEmailFallbackFactory implements FallbackFactory<MessageEmailFeignClient> {
    @Override
    public MessageEmailFeignClient create(Throwable throwable) {
        return new MessageEmailFeignClient() {

            @Override
            public JSONResult saveBatch(List<MessageEmail> messageEmails) {
                return JSONResult.error("邮箱报错错误");
            }
        };
    }
}
